package com.kerbores.meeting.biz.impl;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

import com.kerbores.meeting.biz.IRoleService;
import com.kerbores.meeting.dao.IRoleDao;
import com.kerbores.meeting.domain.Role;
import com.kerbores.utils.web.pager.Pager;

/**
 * @author Kerbores
 *
 *         Create At 2015年1月16日 下午5:21:23
 */
@IocBean(name = "roleService")
public class RoleServiceImpl implements IRoleService {

	@Inject
	private IRoleDao roleDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kerbores.meeting.biz.IRoleService#findBypage(int, int)
	 */
	@Override
	public Pager<Role> findBypage(int page, int pageSize) {
		Pager<Role> pager = new Pager<Role>(pageSize, page);
		pager.setCount(roleDao.countAll());
		pager.setEntities(roleDao.searchByPage(null, page, pageSize));
		return pager;
	}
}
